<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AbstractController::Collector</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Module</span> 
            AbstractController::Collector 
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionpack/lib/abstract_controller/collector_rb.html">actionpack/lib/abstract_controller/collector.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>G</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Collector.html#method-c-generate_method_for_mime">generate_method_for_mime</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>M</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Collector.html#method-i-method_missing">method_missing</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-generate_method_for_mime">
            
              <b>generate_method_for_mime</b>(mime)
            
            <a href="Collector.html#method-c-generate_method_for_mime" name="method-c-generate_method_for_mime" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-generate_method_for_mime_source')" id="l_method-c-generate_method_for_mime_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/021f3d24f32dbad98c72cd5c36ff0b511be07a64/actionpack/lib/abstract_controller/collector.rb#L5" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-generate_method_for_mime_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/collector.rb, line 5</span>
    <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">generate_method_for_mime</span>(<span class="ruby-identifier">mime</span>)
      <span class="ruby-identifier">sym</span> = <span class="ruby-identifier">mime</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">mime</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">mime</span>.<span class="ruby-identifier">to_sym</span>
      <span class="ruby-identifier">const</span> = <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">upcase</span>
      <span class="ruby-identifier">class_eval</span> <span class="ruby-string">&quot;        def #{sym}(*args, &amp;block)                # def html(*args, &amp;block)
          custom(Mime::#{const}, *args, &amp;block)  #   custom(Mime::HTML, *args, &amp;block)
        end                                      # end
&quot;</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-keyword">__LINE__</span> <span class="ruby-operator">+</span> <span class="ruby-number">1</span>
    <span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Protected methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-method_missing">
            
              <b>method_missing</b>(symbol, &amp;block)
            
            <a href="Collector.html#method-i-method_missing" name="method-i-method_missing" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/021f3d24f32dbad98c72cd5c36ff0b511be07a64/actionpack/lib/abstract_controller/collector.rb#L25" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-method_missing_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/collector.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">method_missing</span>(<span class="ruby-identifier">symbol</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">mime_constant</span> = <span class="ruby-constant">Mime</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">upcase</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">SET</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">mime_constant</span>)
    <span class="ruby-constant">AbstractController</span><span class="ruby-operator">::</span><span class="ruby-constant">Collector</span>.<span class="ruby-identifier">generate_method_for_mime</span>(<span class="ruby-identifier">mime_constant</span>)
    <span class="ruby-identifier">send</span>(<span class="ruby-identifier">symbol</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    